#! /bin/bash
export LANG=zh_CN.UTF-8
PRESTO_HOME=/export/server/presto/bin/presto


${PRESTO_HOME} --catalog hive --server 192.168.88.80:8090 --execute "

-- 插入出勤数据
delete from hive.edu_rpt.hkl_rpt_studying_timecnt where 1=1;
insert into hive.edu_rpt.hkl_rpt_studying_timecnt
select
create_date,
class_id,
time_type,
dt,
studying_cnt,
studying_pct
from hive.edu_dm.hkl_dm_check_wide_timecnt ;
-- 插入迟到数据
delete from hive.edu_rpt.hkl_rpt_late_timecn where 1=1;
insert into hive.edu_rpt.hkl_rpt_late_timecn
select
create_date,
class_id,
time_type,
dt,
late_cnt,
late_pct
from hive.edu_dm.hkl_dm_check_wide_timecnt ;
--插入请假数据
delete from hive.edu_rpt.hkl_rpt_leave_timecnt where 1=1;
insert into hive.edu_rpt.hkl_rpt_leave_timecnt
select
create_date,
class_id,
time_type,
dt,
leave_cnt,
leave_pct
from hive.edu_dm.hkl_dm_check_wide_timecnt ;
-- 插入旷课数据
delete from hive.edu_rpt.hkl_rpt_truant_timecnt where 1=1;
insert into hive.edu_rpt.hkl_rpt_truant_timecnt
select
create_date,
class_id,
time_type,
dt,
truant_cnt,
truant_pct
from hive.edu_dm.hkl_dm_check_wide_timecnt ;"